package com.ky.tms.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.ky.tms.entity.TmsOrder;
import com.ky.tms.vo.*;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author chengkaimao
 * @since 2020-03-24
 */
public interface TmsOrderMapper extends BaseMapper<TmsOrder> {

    List<EntryOrder> entryPage(IPage<EntryOrder> pagination, @Param("entryOrder") TmsOrder tmsOrder);

    List<TmsOrder> splitPage(IPage<TmsOrder> pagination, @Param("order") TmsOrder tmsorder);

    List<TmsOrder> dispatchPage(IPage<TmsOrder> pagination, @Param("order") TmsOrder tmsOrder);

    List<TmsOrder> auditPage(IPage<TmsOrder> pagination, @Param("order") TmsOrder tmsOrder );

    List<TmsOrder> invoicePage(IPage<TmsOrder> pagination, @Param("order") TmsOrder tmsOrder);

    List<OrderIncome> incomePage(IPage<OrderIncome> pagination, @Param("order") TmsOrder tmsOrder);

    List<OrderIncomeAudit> incomeAuditPage(IPage<OrderIncomeAudit> pagination, @Param("order")TmsOrder tmsOrder);

    List<OrderIncomeAudit> incomeBar( @Param("order")TmsOrder tmsOrder);

    List<OrderIncomeAudit> reportOrderPage(@Param("parentId") Long parentId);

    List<OrderExportVo> exportOrder(@Param("order") TmsOrder tmsOrder);

    List<TrackOrder> trackOrder(@Param("trackOrder") TrackOrder trackOrder);

    Long trackOrderTotal(@Param("trackOrder") TrackOrder trackOrder);

    List<TmsOrder> splitChildren(@Param("parentId") Long parentId);

    int entryDel(@Param("updateUser")String updateUser, @Param("updateTime") LocalDateTime updateTime, @Param("ids")List<Long> ids);

    int entrySubmit(@Param("updateUser")String updateUser, @Param("updateTime") LocalDateTime updateTime, @Param("ids")List<Long> ids);

    int updateVersion(@Param("updateUser")String updateUser, @Param("updateTime") LocalDateTime updateTime, @Param("id") Long id);

    int delChildren(@Param("parentId") Long parentId);

    int updateStatus(@Param("status") String status, @Param("loadNos") String[] loadNos);


    int invoice(@Param("updateUser")String updateUser, @Param("updateTime") LocalDateTime updateTime, @Param("ids")List<Long> ids);

    int pay(@Param("updateUser")String updateUser, @Param("updateTime") LocalDateTime updateTime, @Param("ids")List<Long> ids);

    int checkCostOrderState(@Param("loadNos") String[] loadNos);

}
